const app = getApp();
import { baseUrl } from "../../../api/request"
import { getStorage } from "../../../utils/localStorage";
import { getMapDistance } from "../../../utils/address"
import { selectScenicSpotDynamices } from "../../../api/homePage"
Page({
    data: {
        navData: {
            level: 2,
            title: '商品详情'
        },
        baseUrl: null,
        scFlag: true,
        navHeight: 0,
        navTop: 0,
        navObj: 0,
        navWeight: 0,
        swiper: {
            autoplay: true, //自动切换
            dots: true, //指示点
            dotsColor: "#ffffff", //指示点颜色
            dotsActiveColor: "#4646A0", //选中指示点颜色
            circular: true, //衔接滑动
            duration: 3000, //滑动动画时长
            boxFlag: false,
        },
        soFlag: false,
        detailObj: {},
        latlng: {},
        listQuery: {
            pageSize: 10,
            pageNum: 1,
            total: 0,
            pullFlag: true,
            landscapesId: null,
        },
        user: null,
        detailObj: {},
        userDynamsList: [],
        navMargin:app.globalData.navHeight+app.globalData.navTop+10,
    },
    onLoad(options) {
        let item = JSON.parse(decodeURIComponent(options.item));
        console.log(item, 'item');
        this.setData({
            detailObj: item,
            "listQuery.landscapesId": item.id
        });
    },
    //导航按钮点击事件
    navigationClick() {
        if (this.data.detailObj.status) {
            let that = this.data;
            wx.openLocation({
                latitude: Number(that.detailObj.latitude),
                longitude: Number(that.detailObj.longitude),
            })
        } else {
            wx.showToast({
                icon: 'none',
                title: '暂无货源',
            })
        }

    },
    onShow() {
    },
    onReady() {

    },
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide() {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload() {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh() {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom() {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage() {

    }
})